package com.ym.soso.enums;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.util.StdConverter;
import com.ym.common.annotations.EnumDescription;
import com.ym.common.constant.DictEnum;


@EnumDescription("标签类型")
public enum TagTypeEnum implements DictEnum {

    //--------------------start-----------------


    SYSTEM("01", "系统"),
    /**
     * 自定义
     */
    CUSTOMER("02", "自定义"),
    //--------------------end-------------------
    ;

    private String key;

    private String value;

    TagTypeEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    @Override
    public String getKey() {
        return this.key;
    }

    @Override
    public String getValue() {
        return this.value;
    }

    /**
     * 序列化使用
     */
    public static class Covert extends StdConverter<String, JSONObject> {
        @Override
        public JSONObject convert(String value) {
            return DictEnum.valueOfJson(TagTypeEnum.class, value);
        }
    }
}
